//
//  ICAsyncSocketConfig.h
//  ICome
//
//  Created by zhangrongwu on 16/3/14.
//  Copyright © 2016年 iCom. All rights reserved.
//

#ifndef ICAsyncSocketConfig_h
#define ICAsyncSocketConfig_h

typedef enum {
    ICConnectCmdType_None        = 0, // 未登录
    ICConnectCmdType_Connect     = 1, // 连接请求
    ICConnectCmdType_ConnectBack = 2, // 连接请求 正确 回调
    ICConnectCmdType_HeartBeat         = 3, // 心跳请求
    ICConnectCmdType_HeartBeatBack     = 4, // 心跳请求 正确 回调
    ICConnectCmdType_LocFunc     = 5,  //功能本地调用(相对于 7)
    ICConnectCmdType_LocFuncBack       = 6, // 功能本地调用 正确 回调
    ICConnectCmdType_LongDistanceFunc  = 7, // 功能远程调用
    ICConnectCmdType_LongDistanceFuncBack = 8, // 功能远程调用 正确 回调
    ICConnectCmdType_EnterBackground   = 9, // APP切到后台
    ICConnectCmdType_Notify       = 10, // 消息更新提示
    ICConnectCmdType_Message      = 11, // 推送更新内容
    ICConnectCmdType_SystemAction = 12, // 系统操作消息
    ICConnectCmdType_ActionBack   = 13, // 系统操作确认
}SocketrequestType;

/**
 *  socket config
 */
//online 1 local 0 user is login
#define DEV_STATE_ONLINE 1

static const int TIMEOUT = 30;
static const int heartBeatTimeinterval = 40.0;
static const int kMaxReconnection_time = 6;

#define UPLOAD_ENV_ONLINE @"online"
#define UPLOAD_ENV_LOCAL @"local"

#if DEV_STATE_ONLINE //(已迁移到 ICConstants中)
static NSString *HOST = @"183.196.130.101"; //socket
static const int PORT = 6201;
#else
static NSString *HOST = @"183.196.130.101"; //socket
static const int PORT = 6201;
#endif

/**
 *  socket protocol version
 */
#define PROTOCOL_VERSION 3

static const int beatLimit = 10;

#endif /* ICAsyncSocketConfig_h */
